import request from '@/utils/request';

//响应慢业务告警详情信息
export function alarmDetail(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ops/alarmDetail/getAlarmDetailOverview',
		method: 'post',
		data: data,
	});
}

// 响应耗时、失败率、健康度告警分布趋势
export function getAlarmTrend(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ops/alarmDetail/getAlarmDetailTrend',
		method: 'post',
		data: data,
	});
}

// 区域分析-响应慢
export function getAreaAnalysis(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ops/alarmDetail/getAreaAlarmAnalysis',
		method: 'post',
		data: data,
	});
}

//步骤分析列表
export function stepAnalysis(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ops/alarmDetail/getStepAnalysis',
		method: 'post',
		data: data,
	});
}

//步骤分析列表下载
export function stepAnalysisDownLoad(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ops/alarmDetail/getStepAnalysisExcel',
		method: 'post',
		data: data,
		responseType: 'blob',
	});
}

//接口分析列表
export function apiAnalysis(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ops/alarmDetail/getPublicStepAnalysis',
		method: 'post',
		data: data,
	});
}

//接口分析列表下载
export function apiAnalysisDownLoad(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ops/alarmDetail/getPublicStepAnalysisExcel',
		method: 'post',
		data: data,
		responseType: 'blob',
	});
}

//告警分类统计
export function alarmClassify(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ops/alarmDetail/getAlarmClassificationStatistics',
		method: 'post',
		data: data,
	});
}

//告警分类统计下载接口
export function alarmClassifyDownLoad(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ops/alarmDetail/getAlarmClassificationStatisticsExcel',
		method: 'post',
		data: data,
		responseType: 'blob',
	});
}

//告警分类统计title
export function queryBaseAlarmTypes(): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ywgzt/alarm/responSlow/queryBaseAlarmTypes',
		method: 'post',
	});
}

// 影响用户
export function affectUser(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ops/alarmDetail/getAffectUser',
		method: 'post',
		data: data,
	});
}

// 影响用户下载
export function affectUserDownLoad(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ops/alarmDetail/getAffectUserExcel',
		method: 'post',
		data: data,
		responseType: 'blob',
	});
}

// 影响系统
export function affectSystem(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ops/alarmDetail/getAffectSystem',
		method: 'post',
		data: data,
	});
}
// 影响系统下载
export function affectSystemDownLoad(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ops/alarmDetail/getAffectSystemExcel',
		method: 'post',
		data: data,
		responseType: 'blob',
	});
}

// 影响业务
export function affectBusiness(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ops/alarmDetail/getAffectBusiness',
		method: 'post',
		data: data,
	});
}

// 影响业务下载
export function affectBusinessDownLoad(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ops/alarmDetail/getAffectBusinessExcel',
		method: 'post',
		data: data,
		responseType: 'blob',
	});
}

// 影响用户
export function exportEffectUser(query: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ywgzt/alarm/responSlow/affectUserExport',
		method: 'post',
		data: query,
		timeout: 3000000,
		responseType: 'blob',
	});
}

// // 影响系统
// export function exportEffectSys(query): ApiPromise<ApiResponse> {
//   return request({
//     url: '/ops-workbench/ywgzt/alarm/responSlow/affectSystemExcel',
//     method: 'post',
//     data: query,
//     timeout: 3000000,
//     responseType: 'blob'
//   });
// }

// 影响业务
export function exportEffectBusi(query: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ywgzt/alarm/responSlow/affectBusinessExport',
		method: 'post',
		data: query,
		timeout: 3000000,
		responseType: 'blob',
	});
}

// 步骤分析、告警分类弹窗列表
export function stepToBaseAlarmList(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ops/alarmDetail/getStepAnalysisAlarmDetail',
		method: 'post',
		data: data,
	});
}

// 步骤分析、告警分类弹窗下载
export function stepToBaseAlarmListDownLoad(query: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ops/alarmDetail/getStepAnalysisAlarmDetailExcel',
		method: 'post',
		data: query,
		timeout: 3000000,
		responseType: 'blob',
	});
}

// 步骤分析弹窗下载
export function queryExport(query: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ywgzt/alarm/responSlow/stepToBaseAlarmListExport',
		method: 'post',
		data: query,
		timeout: 3000000,
		responseType: 'blob',
	});
}
